#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
int main ()
{
  pid_t id  = fork();
  if(id == 0)
  {
    //child
    while(1)
    {
      sleep(1);
      printf("I am a child,my pid:%d, ppid:%d\n",getpid(),getppid());
      exit(1);
    }
  }
  else{
    //parent
    while(1)
    {
      sleep(5);
      printf("I am a parent,my pid:%d, ppid:%d\n",getpid(),getppid());
    }
  }

  //printf("hello world!\n");
  return 0;
}
